We develop a model of gravitational lensing in a non-uniform plasma. When a gravitating body is surrounded by a plasma, the lensing angle depends on the frequency of the electromagnetic wave, due to dispersion properties of plasma, in presence of a plasma inhomogeneity, and of a gravity. The second effect leads, even in a uniform plasma, to a difference of the gravitational photon deflection angle from the vacuum case, and to its dependence on the photon frequency. We take into account both effects, and derive the expression for the lensing angle in the case of a strongly nonuniform plasma in presence of the gravitation. Dependence of the lensing angle on the photon frequency in a homogeneous plasma resembles the properties of a refractive prism spectrometer, which strongest action is for very long radiowaves. We discuss the observational appearances of this effect for the gravitational lens with a Schwarzschild metric, surrounded by a uniform plasma. We obtain formulae for the lensing angle and the magnification factors in this case and discuss a possibility of observation of this effect by the planned VLBI space project Radioastron. We also consider models with a nonuniform plasma distribution. For different gravitational lens models we compare the corrections to the vacuum lensing due to the gravitational effect in plasma, and due to the plasma inhomogeneity. We have shown that the gravitational effect could be detected in the case of a hot gas in the gravitational field of a galaxy cluster.